<template>
  <div style="width: 300px;height: 500px;margin: auto">
    <el-form ref="form" :model="form" label-width="80px">
      <el-form-item label="用户名">
        <el-input prefix-icon="el-icon-user-solid" v-model="form.name" size="medium" ></el-input>
      </el-form-item>
      <el-form-item label="密码">
        <el-input prefix-icon="el-icon-key" v-model="form.password" size="medium" ></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">登录</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>

import UserInfoUtils from "@/utils/UserInfoUtils";
export default {
  name: "login",

  data() {
    return {
      form: {
        name: '',
        password: ''
      }
    }
  },

  created() {
    // this.$axios.del("/testAjax/"+"1",function (data){
    //   console.log(data)
    // })
  },

  methods: {
    onSubmit() {
      var user = {
        id: 1,
        number: "admin",
        username: "admin"
      }
      UserInfoUtils.setUserInfo(user)
      // var menuList = this.$router.menuList

      // console.log(this.form)
      // console.log('submit!');
      // console.log(this.$router)
      // let links = menuList[0].path + '/' + manuList[0].children[0].path;
      // this.$router.push({
      //   path:links
      // })
    }
  }
}
</script>

<style scoped>

</style>
